From: Florian Müllner Date: Mon, 5 Dec 2022 12:56:57 +0000 (+0100) Subject: fileUtils: Do not follow symlinks X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~199 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1a9e072ca000c4033bf0c5be8facaced341206d8;p=gnome-shell.git fileUtils: Do not follow symlinks Extensions should not include symlinks, in particular ones that point outside the extension directory. However if they do, then we should only move/remove the link rather than the files it points to. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6182 Part-of: --- diff --git a/js/misc/fileUtils.js b/js/misc/fileUtils.js index e9ea92a51..528a76350 100644 --- a/js/misc/fileUtils.js +++ b/js/misc/fileUtils.js @@ -45,7 +45,7 @@ function* collectFromDatadirs(subdir, includeUserDir) { function recursivelyDeleteDir(dir, deleteParent) { let children = dir.enumerate_children('standard::name,standard::type', - Gio.FileQueryInfoFlags.NONE, null); + Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null); let info; while ((info = children.next_file(null)) != null) { @@ -63,7 +63,7 @@ function recursivelyDeleteDir(dir, deleteParent) { function recursivelyMoveDir(srcDir, destDir) { let children = srcDir.enumerate_children('standard::name,standard::type', - Gio.FileQueryInfoFlags.NONE, null); + Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null); if (!destDir.query_exists(null)) destDir.make_directory_with_parents(null);